
<div id="conte-middle">
	<section class="posts">
		<header class="p-head">
			<h1><?php echo (isset($seo['title2'])? lang('v_search').' => '.$seo['title2']: lang('v_search')); ?></h1>
		</header>
		
<?php
	if(isset($resultados['result_search'])){
		$req_uri = preg_replace(array('/\&pag=([0-9]+|)/', '/\?pag=([0-9]+|)/'), array('',''), 
					$_SERVER['REQUEST_URI']);
		$vsegment = explode('?', $req_uri);
		//Paginacion
		$this->pagination->initialize(array(
			'base_url' 			=> Sys::$url_base.$this->uri->uri_string().'/',
			'total_rows'		=> $resultados['total_rows'],
			'per_page'			=> $resultados['items_per_page'],
			'cur_page'			=> $resultados['result_page']*$resultados['items_per_page'],
			'page_query_string'	=> TRUE,
			'query_string_segment'=> (isset($vsegment[1])? '?'.$vsegment[1].'&pag': '?pag'),
			'num_links'			=> 1,
			'anchor_class'		=> 'pags corner-all'
		));
		$pagination = $this->pagination->create_links();
		echo '<div class="pagination w100">'.$pagination.'</div>';
		
		foreach ($resultados['result_search'] as $key => $value){
			
?>
			<div class="resultado_busqueda">
                <a href="<?php echo base_url($value['url_web']); ?>"><?php echo $value['titulo']; ?></a>
                <div class="url_resultado_buscador"><?php echo base_url($value['url_web']); ?></div>
            </div>
<?php
		}
		
		echo '<div class="pagination">'.$pagination.'</div>';
	}
?>
		
	</section>

